package com.pmcc.cj.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pmcc.cj.entity.vo.OrderVo;
import com.pmcc.core.entity.UUIDEntity;
import com.pmcc.utils.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单表
 * Created by 姚楠 on 2020/10/5.
 */
@Entity
@Table(name = "cj_order_index")
public class CjOrderIndex extends UUIDEntity {

    @Column(name = "money")
    private BigDecimal money;//总金额
    @Column(name = "employee_id")
    private String employeeId;//用户id
    @Column(name = "name")
    private String name;//用户名称
    @Column(name = "cellphone")
    private String cellphone;//手机号
    //支付状态  0：未支付   1：已支付（待实施）   2:退单    3：取消    4：已完成（待评价）     5：已评价
    @Column(name = "pay_status")
    private Integer payStatus;
    @Column(name = "pay_id")
    private String payId;//订单号
    @Column(name = "wx_pay_id")
    private String wxpayId;//支付ID
    @Column(name = "create_time")
    private Date createTime;//创建时间


    //存储订单信息
    @Column(name = "app_id")
    private String appId;
    @Column(name = "mch_id",length = 2000)
    private String mchId;
    @Column(name = "prepay_id",length = 2000)
    private String prepayId;
    @Column(name = "nonce_str",length = 2000)
    private String nonceStr;
    @Column(name = "time_stamp",length = 2000)
    private String timeStamp;
    @Column(name = "sign",length = 2000)
    private String sign;
    @Column(name = "out_trade_no",length = 2000)
    private String outTradeNo;

    @Transient
    private List<OrderVo> orderVos;
    @Transient
    private Integer flags;//用于查询退款的数据 flags=1

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getPrepayId() {
        return prepayId;
    }

    public void setPrepayId(String prepayId) {
        this.prepayId = prepayId;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    public String getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(String timeStamp) {
        this.timeStamp = timeStamp;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public List<OrderVo> getOrderVos() {
        return orderVos;
    }

    public void setOrderVos(List<OrderVo> orderVos) {
        this.orderVos = orderVos;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public String getPayId() {
        return payId;
    }

    public void setPayId(String payId) {
        this.payId = payId;
    }

    public String getWxpayId() {
        return wxpayId;
    }

    public void setWxpayId(String wxpayId) {
        this.wxpayId = wxpayId;
    }
    @JsonSerialize(using = DateTimeFormat.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getFlags() {
        return flags;
    }

    public void setFlags(Integer flags) {
        this.flags = flags;
    }
}
